package com.piece.mall.model;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

@Data
@Entity
@NoArgsConstructor
@Table(name = "oms_order_return_apply")
@ApiModel(value = "订单退货申请")
public class OmsOrderReturnApply implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id", length = 11)
    @ApiModelProperty(value = "主键")
    private Long id;

    @Column(name = "order_id")
    @ApiModelProperty(value = "订单主键")
    private Long orderId;

    @Column(name = "sku_id")
    @ApiModelProperty(value = "退货商品主键")
    private Long skuId;

    @Column(name = "order_sn")
    @ApiModelProperty(value = "订单编号")
    private String orderSn;

    @Column(name = "create_time")
    @ApiModelProperty(value = "申请时间")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date createTime;

    @Column(name = "member_username")
    @ApiModelProperty(value = "会员用户名")
    private String memberUsername;

    @Column(name = "return_amount")
    @ApiModelProperty(value = "退款金额")
    private Long returnAmount;

    @Column(name = "return_name")
    @ApiModelProperty(value = "退货人姓名")
    private String returnName;

    @Column(name = "return_phone")
    @ApiModelProperty(value = "退货人电话")
    private String returnPhone;

    @Column(name = "status")
    @ApiModelProperty(value = "申请状态", notes = "0=待处理, 1=已完成, 2=已拒绝")
    private String status;

    @Column(name = "handle_time")
    @ApiModelProperty(value = "处理时间")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date handleTime;

    @Column(name = "sku_img")
    @ApiModelProperty(value = "商品图片")
    private String skuImg;

    @Column(name = "sku_name")
    @ApiModelProperty(value = "商品名称")
    private String skuName;

    @Column(name = "sku_brand")
    @ApiModelProperty(value = "商品品牌")
    private String skuBrand;

    @Column(name = "sku_attrs_value")
    @ApiModelProperty(value = "商品销售属性", notes = "JSON字符串")
    private String skuAttrsValue;

    @Column(name = "sku_count")
    @ApiModelProperty(value = "退货数量")
    private Long skuCount;

    @Column(name = "sku_price")
    @ApiModelProperty(value = "商品单价")
    private Long skuPrice;

    @Column(name = "sku_real_price")
    @ApiModelProperty(value = "商品实际支付单价")
    private Long skuRealPrice;

    @Column(name = "reason")
    @ApiModelProperty(value = "原因")
    private String reason;

    @Column(name = "description")
    @ApiModelProperty(value = "描述")
    private String description;

    @Column(name = "desc_pics")
    @ApiModelProperty(value = "凭证图片", notes = "以逗号隔开")
    private String descPics;

    @Column(name = "handle_remark")
    @ApiModelProperty(value = "处理备注")
    private String handleRemark;

    @Column(name = "handle_man")
    @ApiModelProperty(value = "处理人员")
    private String handleMan;

    @Column(name = "receive_man")
    @ApiModelProperty(value = "收货人")
    private String receiveMan;

    @Column(name = "receive_time")
    @ApiModelProperty(value = "收货时间")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date receiveTime;

    @Column(name = "receive_remark")
    @ApiModelProperty(value = "收货备注")
    private String receiveRemark;

    @Column(name = "receive_phone")
    @ApiModelProperty(value = "收货电话")
    private String receivePhone;

    @Column(name = "company_address")
    @ApiModelProperty(value = "公司收货地址")
    private String companyAddress;
}
